<script id="timelineTemplate" type="text/template" >
{{#weibo}}
<li data-id="{{id}}" class="item-content card-content">
    <div class="item-inner">
        <div class="item-header">
            <div class="avatar">
                <img data-avatarid="{{avatar}}" src="style/img/avatar/avatar{{avatar}}.jpg">
            </div>
            <div class="detail">
                <p class="nickname">{{nickname}}</p>
                <p data-time="{{created_at}}" class="create-time">{{../time}}</p>
            </div>
        </div>

        <div class="click-content">

            <div class="item-subtitle">
                {{../finalText}}
            </div>

            {{#if original_pic}}
            <div class="item-image">
                <img src="{{original_pic}}" alt="">
            </div>
            {{/if}}

        </div>


        <div class="item-tools">
            <ul>
                <li><i class="icon ios7-redo-outline"></i><span class="text">{{../i18n.forward}}</span></li>
                <li class="tool-line"></li>
                <li><a href="page/item.html?id={{id}}"><i class="icon ios7-chatbubble-outline"></i><span class="text">{{../i18n.comment}}</span></a></li>
                <li class="tool-line"></li>
                <li><i class="icon ios7-heart-outline"></i><span class="text">{{../i18n.like}}</span></li>
            </ul>
        </div>

    </div>
</li>
{{/weibo}}
</script>

<script id="itemTemplate" type="text/template" >
    <div class="item-header">
        <div class="avatar">
            <img src="style/img/avatar/avatar{{avatar}}.jpg">
        </div>
        <div class="detail">
            <p class="nickname">{{nickname}}</p>
            <p data-time="{{created_at}}" class="create-time">{{time}}</p>
        </div>
    </div>
<div class="item-subtitle">
{{text}}
</div>
{{#if image}}
<div class="item-image">
  <img src="{{image}}" alt="">
</div>
{{/if}}
</script>

<script id="commentsTemplate" type="text/template" >
{{#each comments}}
<li class="comment-item">
    <div class="avatar">
      <img src="style/img/avatar/avatar{{avatar}}.jpg" alt="">
    </div>
    <div class="comment-detail">
      <div class="name">{{name}}</div>
      <div class="text">{{text}}</div>
      <div class="time">{{rtime}}</div>
    </div>
</li>
{{else}}
<div class="none-comment">
  <i class="icon ios7-chatboxes-outline"></i>
  <p>{{emptyComment}}</p>
</div> 
{{/each}}
</script>

<script id="commentPopupTemplate" type="text/template">
    <div class="popup comment-popup">
        <div class="view navbar-fixed">
            <div class="page">
                <div class="navbar">
                    <div class="navbar-inner">
                        <div class="left"><a href="#" class="link close-popup">{{cancel}}</a></div>
                        <div class="center">{{title}}</div>
                        <div class="right"><a id="commentBtn" href="#" class="link orange">{{send}}</a></div>
                    </div>
                </div>
                <div class="page-content message-content">

                    <div class="message-input">
                        <textarea id="commentText" placeholder="{{placeholder}}"></textarea>
                    </div>

                    <div class="message-tools">
                        <ul>
                            <li><i class="icon ios7-emotion"></i></li>
                            <li><i class="icon ios7-at-outline"></i></li>
                        </ul>
                    </div>

                </div>
            </div>
        </div>
    </div>
</script>

<script id="sendPopupTemplate" type="text/template">
    <div class="send-popup popup">
        <div class="view navbar-fixed">
            <div class="page">
                <div class="navbar">
                    <div class="navbar-inner">
                        <div class="left"><a href="#" class="link close-popup">{{cancel}}</a></div>
                        <div class="center">{{senTweet}}</div>
                        <div class="right"><a id="sendWeiboBtn" href="#" class="link orange">{{send}}</a></div>
                    </div>
                </div>
                <div class="page-content message-content">

                    <div class="message-input">
                        <textarea id="messageText" placeholder="{{sendPlaceholder}}"></textarea>
                    </div>

                    <div class="message-tools">
                        <ul>
                            <li class="camera image-upload">
                                <i class="icon ios7-camera-outline"></i>
                            </li>
                            <li class="photoalbum image-upload">
                                <i class="icon ios7-pic"></i>
                            </li>
                            <li><i class="icon ios7-emotion"></i></li>
                            <li><i class="icon ios7-at-outline"></i></li>
                            <li class="get-position"><i class="icon ios7-dingxiang"></i></li>
                        </ul>
                    </div>

                    <div id="geoInfo" class="geo-info">
                        <div class="location"><i class="icon preloader"></i><span class="info">{{loadingGeo}}</span></div>
                        <div class="close"><i class="icon ios7-close"></i></div>
                    </div>

                    <div id="uploadPicPreview" class="upload-pic-preview">
                        <img src="" alt="" />
                    </div>

                </div>
            </div>
        </div>
    </div>
</script>

<script id="settingTemplate" type="text/template">
    <div class="page-content">
        <div class="setting-page list-block">
            <ul>
                <li>
                    <div class="item-content">
                        <div class="item-inner user-info">
                            <div class="avatar">
                                <img src="{{avatarUrl}}" alt="">
                            </div>
                            <div class="user-detail">
                                <div class="name">{{i18nNickName}}: {{nickName}}</div>
                                <div class="point">{{i18nPoints}}: {{points}}</div>
                            </div>
                        </div>
                    </div>
                </li>
                <li>
                    <a href="page/feedback.html" class="item-link">
                        <div class="item-content">
                            <div class="item-media feedback spring"></div>
                            <div class="item-inner">
                                <div class="item-title">{{feedBack}}</div>
                            </div>
                        </div>
                    </a>
                </li>
                <li>
                    <a href="#" class="update-button item-link">
                        <div class="item-content">
                            <div class="item-media update spring"></div>
                            <div class="item-inner">
                                <div class="item-title">{{checkUpdate}}</div>
                            </div>
                        </div>
                    </a>
                </li>
                <li>
                    <a href="page/language.html?from=setting" class="item-link">
                        <div class="item-content">
                            <div class="item-media language">
                                <i class="icon ios7-world-outline"></i>
                            </div>
                            <div class="item-inner">
                                <div class="item-title">{{language}}</div>
                            </div>
                        </div>
                    </a>
                </li>
                <li>
                    <a href="page/about.html" class="item-link">
                        <div class="item-content">
                            <div class="item-media about spring"></div>
                            <div class="item-inner">
                                <div class="item-title">{{about}}</div>
                            </div>
                        </div>
                    </a>
                </li>
            </ul>
            <a href="#" class="button button-big logout-button button-fill color-red">{{loginOut}}</a>
        </div>
    </div>
</script>

<script id="contactListTemplate" type="text/template">
    {{#contacts}}
    {{#if header}}
    <li class="list-group-title">{{header}}</li>
    {{/if}}
    <li class="contact-item">
        <a href="page/message.html?nickname={{nickname}}" class="item-link">
            <div class="item-content">
                <div class="item-media"><img src="style/img/avatar/avatar{{avatar}}.jpg" width="44"></div>
                <div class="item-inner">
                    <div class="item-title-row">
                        <div class="item-title">{{nickname}}</div>
                    </div>
                    <div class="item-subtitle">{{location}}</div>
                </div>
            </div>
        </a>
    </li>
    {{/contacts}}
</script>

<script id="messageTemplate" type="text/template">
    {{#each message}}
    {{#if date}}
    <div class="messages-date">{{date}}</div>
    {{/if}}
    {{#if image}}
    <div class="message message-{{from}} message-pic ">
        <div class="message-text"><img src="{{text}}"/></div>
    </div>
    {{else}}
    <div class="message message-{{from}} message-last">
        <div class="message-text">{{text}}</div>
    </div>
    {{/if}}
    {{/each}}
</script>